package com.lhdx.practical.service.impl;

import com.lhdx.practical.bean.Fraction;
import com.lhdx.practical.dao.FractionDao;
import com.lhdx.practical.service.FractionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("FractionService")
public class FractionServiceImpl implements FractionService {
    @Autowired
    private FractionDao fractionDao;

    @Override
    public void save(Fraction fraction) {
        fractionDao.save(fraction);
    }

    @Override
    public List<Fraction> findAllByAuthoridAndGroupidAndSid(long authorid,long groupid,long sid){
        return fractionDao.findAllByAuthoridAndGroupidAndSid(authorid,groupid,sid);
    }

    @Override
    public List<Fraction> findAllByPersonidAndGroupidAndMid(long personid,long groupid,long mid) {
        return fractionDao.findAllByPersonidAndGroupidAndMid(personid,groupid,mid);
    }

    @Override
    public void updateTeacherScore(long id, double teacherscore,long sid) {
        fractionDao.updateTeacherScore(id,teacherscore,sid);
    }

    @Override
    public Fraction findByPersonidAndSidAndAuthorid(long personid, long sid,long authorid) {
        return fractionDao.findByPersonidAndSidAndAuthorid(personid,sid,authorid);
    }


}
